package com.wn.sk.product;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import feign.Logger;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

/**
 * @author yellow Docter
 * @date 2022 -11-07
 * @desc
 */
@EnableSwagger2WebMvc //兼容版本问题
@SpringBootApplication(
        scanBasePackages = {   //扫描指定的包
                "com.wn.sk"
        }
)
@MapperScan("com.wn.sk.product.mapper")
@EnableCaching       //开启缓存注解
@EnableScheduling    //开启定时任务的注解
@EnableFeignClients(
        basePackages = "com.wn.sk.order.client"
)
public class ProductApplication {

    public static void main(String[] args) {

        SpringApplication.run(ProductApplication.class, args);

    }

    /**
     *  openfeign的 日志配置
     * @return
     */
    @Bean
    public Logger.Level loggerLevel(){
        return Logger.Level.FULL;
    }

}
